<?php

namespace App\Models;

class MbTplLayout extends Model
{
    protected $table = 'yf_mb_tpl_layout';
    protected $primaryKey = 'mb_tpl_layout_id';
    public $timestamps = false;
    protected $guarded = ['mb_tpl_layout_id'];
    protected $casts = ['mb_tpl_layout_data' => 'array'];

    public static function getEnableLayouts()
    {
        return self::where([
                'mb_tpl_layout_enable' => 1,
                'sub_site_id' => 0
            ])
            ->oldest('mb_tpl_layout_order')
            ->get();
    }
}
